package org.zcl.elastic.service;

import com.fasterxml.jackson.databind.node.ObjectNode;
import org.elasticsearch.index.query.QueryBuilder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.zcl.elastic.entity.Scroll;
import org.zcl.elastic.entity.ScrollDeepRequest;
import org.zcl.elastic.entity.ScrollRequest;
import org.zcl.elastic.entity.User;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/9/8 21:35
 */
public interface UserService {

    Scroll<ObjectNode> findScroll(ScrollRequest request);
    Scroll<ObjectNode> continueScroll(String scrollId);

    List<User> findDeepSearch(ScrollDeepRequest request, Class objectClass);

    User save(User user);

    void deleteById(String id);

    Iterable<User> findAll();

    Optional<User> findById(String number);

    long count();

    Boolean existsById(String number);

    Iterable<User> findAllById(ArrayList<String> ids);

    List<User> findByAddressLikeIgnoreCaseOrderByAgeDesc(String 河北);

    Page<User> findByUserNameContaining(String number, PageRequest of);

    User findByAge(int i);

    List<User> findByGender(String 女);

    Iterable<User> search(QueryBuilder queryBuilder);
}
